import React, {Component} from 'react'
import {View, Text, ScrollView, StyleSheet, Image, Dimensions,TouchableOpacity} from 'react-native'
import LoadingCommon from '../common/loading_common'
import Icon from 'react-native-vector-icons/Ionicons'
import styles,{BLUE} from '../../config/styles'
var {height, width} = Dimensions.get('window')
import ScrollableTabView from 'react-native-scrollable-tab-view'
import { VictoryBar, VictoryChart, VictoryAxis, VictoryVoronoiContainer } from 'victory-native';
import NavigatorService from '../../config/navigate_service'
import getUserHeaderImg from '../../helpers/infomation'


class StudentStaticItem extends Component {

    constructor (props) {
        super(props)
        this.state = {
            loading: false
        }
    }

    componentDidMount () {
    }

    getData = () => {
    }

    render () {
        const studentStatic = this.props.studentStatic
        if (this.state.loading) {
            return <LoadingCommon />
        } else {
            return (
                    <View style={{flexDirection: 'row'}}>
                        <View><Image source={getUserHeaderImg(studentStatic.student)} style={{height: 60, width: 60,marginTop:15}} /></View>
                        <View style={{borderBottomWidth: 1,borderBottomColor: '#eaeefe',flex:1}}>
                            <View style={{marginTop:15,marginLeft:15}}><Text style={{fontSize: 16}}>{studentStatic.student.name}</Text></View>
                            <View style={{marginTop:15,marginLeft:15}}><Text style={{fontSize: 10,color:'#666666'}}>完成课文 <Text style={{fontSize: 12,color:'#3398db'}}>{studentStatic.chapter_count}</Text> 套 获得 <Text style={{fontSize: 12,color:'#3398db'}}>{studentStatic.stars}</Text> 颗星 时间 <Text style={{fontSize: 12,color:'#3398db'}}>{studentStatic.audio_times}</Text> 小时</Text></View>
                            <View style={{marginTop:15,marginLeft:15,marginBottom:10}}><Text style={{fontSize: 10,color:'#999999'}}>近三个月内练习了 <Text style={{fontSize: 12,color:'#f29567'}}>{studentStatic.recent_audio_count}</Text> 次，挑战了 <Text style={{fontSize: 12,color:'#f29567'}}>{studentStatic.recent_chapter_count}</Text> 次</Text></View>
                        </View>
                        <View style={{borderBottomWidth: 1,borderBottomColor: '#eaeefe',alignItems: 'center', justifyContent: 'center'}}>
                            <TouchableOpacity
                                style={[styles.as_radio_button]}
                                onPress={() => NavigatorService.navigate('student_symbol_show',{studentId:studentStatic.student.id})}
                            >
                                <Text style={{fontSize:12,color: BLUE}}>错音统计</Text>
                            </TouchableOpacity>

                        </View>
                    </View>
            )
        }

    }
}

export default StudentStaticItem